package com.zxx.pattern.commandPattern.command2;

/**
 * 这里就主要是把所有 具体命令类统一起来：遥控器类
 *
 * 实际没啥用
 * 系统需要将一组操作组合在一起，即支持宏命令。
 *
 * @author zxx on 2021/3/4
 */
public class Controller {

    private Command openTvCommand;
    private Command closeTvCommand;
    private Command changeTvCommand;

    public Controller(Command openTvCommand, Command closeTvCommand, Command changeTvCommand) {
        this.openTvCommand = openTvCommand;
        this.closeTvCommand = closeTvCommand;
        this.changeTvCommand = changeTvCommand;
    }


    public void open(){
        openTvCommand.execute();
    }

    public void close(){
        closeTvCommand.execute();
    }

    public void change(){
        changeTvCommand.execute();
    }

}
